* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    background: #f4f6fa;
    color: #333;
}

.platform-shell {
    min-height: 100vh;
    display: flex;
}

.platform-sidebar {
    width: 260px;
    min-width: 260px;
    background: #141a2e;
    color: #e6e9f2;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.platform-brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 22px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-nav {
    flex: 1;
    padding: 18px 12px;
}

.platform-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #c8cde0;
    text-decoration: none;
    font-size: 15px;
    margin-bottom: 6px;
    transition: background 0.2s, color 0.2s;
}

.platform-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.platform-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.platform-auth {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    color: #aeb5cc;
}

.platform-auth a {
    color: #c9d2ff;
    text-decoration: none;
}

.platform-auth a:hover {
    text-decoration: underline;
}

.platform-main {
    flex: 1;
    min-width: 0;
    padding: 28px 36px;
}

.platform-page-header {
    margin-bottom: 24px;
}

.platform-page-header h1 {
    margin: 0 0 6px;
    font-size: 26px;
}

.platform-page-header p {
    margin: 0;
    color: #777;
}

.chat-card {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(25, 32, 60, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.chat-header {
    padding: 18px 24px;
    border-bottom: 1px solid #eef0f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-title {
    font-size: 17px;
    font-weight: 700;
}

.progress-wrap {
    width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #777;
}

.progress-track {
    flex: 1;
    height: 8px;
    background: #edf0f7;
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 60%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 99px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.chat-day {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    margin: 12px 0 18px;
}

.message-row {
    display: flex;
    margin-bottom: 18px;
}

.message-row.user {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 68%;
    padding: 12px 16px;
    border-radius: 14px;
    line-height: 1.7;
    font-size: 14px;
    white-space: pre-wrap;
}

.message-row.assistant .message-bubble {
    background: #f2f4fb;
    border-bottom-left-radius: 4px;
}

.message-row.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-input {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #eef0f6;
    background: #fff;
}

.chat-input textarea {
    flex: 1;
    height: 48px;
    resize: none;
    border: 1px solid #dfe3ee;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.chat-input textarea:focus {
    border-color: #667eea;
}

.btn {
    border: none;
    border-radius: 10px;
    padding: 0 18px;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.position-list {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 34px rgba(25, 32, 60, 0.07);
    overflow: hidden;
}

.position-table {
    width: 100%;
    border-collapse: collapse;
}

.position-table th,
.position-table td {
    text-align: left;
    padding: 16px 18px;
    border-bottom: 1px solid #eef0f6;
    font-size: 14px;
}

.position-table th {
    color: #888;
    font-weight: 600;
    background: #fafbfe;
}

.position-table tr:last-child td {
    border-bottom: none;
}

.position-title {
    font-weight: 700;
    color: #333;
}

.position-title-link {
    display: inline-block;
    color: #333;
    font-weight: 700;
    text-decoration: none;
}

.position-title-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.company-filter-link {
    color: #555;
    text-decoration: none;
}

.company-filter-link:hover {
    color: #667eea;
    text-decoration: underline;
}

.position-meta {
    margin-top: 4px;
    color: #999;
    font-size: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    background: #eef7f0;
    color: #27ae60;
}

.status-action {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid transparent;
    margin-right: 6px;
}

.status-publish {
    color: #fff;
    background: #667eea;
}

.status-close {
    color: #666;
    background: #f2f4f8;
    border-color: #dfe3ee;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-header-actions {
    display: flex;
    gap: 10px;
}

.detail-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 34px rgba(25, 32, 60, 0.07);
    padding: 22px 26px;
    margin-bottom: 20px;
}

.detail-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid #eef0f6;
}

.detail-card-header h2 {
    margin: 0;
    font-size: 19px;
}

.detail-subtitle {
    margin-top: 4px;
    color: #888;
    font-size: 13px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 32px;
}

.detail-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 14px;
    line-height: 1.7;
}

.detail-item.full {
    grid-column: 1 / -1;
    display: block;
}

.detail-label {
    min-width: 130px;
    color: #888;
    flex-shrink: 0;
}

.detail-value {
    color: #333;
    word-break: break-all;
}

.link-button {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid #667eea;
    color: #667eea;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.link-button:hover {
    background: #667eea;
    color: #fff;
}

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 32, 0.42);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-mask.open {
    display: flex;
}

.modal-card {
    width: 560px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}

.modal-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.modal-sub {
    color: #888;
    font-size: 13px;
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-size: 13px;
}

.form-group select,
.form-group input {
    width: 100%;
    height: 40px;
    border: 1px solid #dfe3ee;
    border-radius: 9px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.btn-ghost {
    background: #f2f4f8;
    color: #555;
}

@media (max-width: 900px) {
    .platform-shell {
        flex-direction: column;
    }

    .platform-sidebar {
        width: 100%;
        min-width: 100%;
        min-height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }

    .platform-nav {
        display: flex;
        flex-direction: row;
        padding: 8px;
    }

    .platform-auth {
        border-top: 0;
        white-space: nowrap;
    }

    .platform-main {
        padding: 18px;
    }

    .chat-card {
        height: calc(100vh - 230px);
    }
}
