:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.main-nav {
    display: flex;
    gap: 4px;
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--primary-color);
    color: white;
}

.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.company-select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 200px;
    background: var(--card-bg);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.company-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.company-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.company-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.company-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.company-card-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.company-card-position {
    font-size: 14px;
    color: var(--primary-color);
    margin-top: 4px;
}

.company-card-actions {
    display: flex;
    gap: 8px;
}

.company-card-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.company-card-actions .edit-btn {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.company-card-actions .delete-btn {
    background: #fef2f2;
    color: var(--danger-color);
}

.company-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.company-card-info-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.company-card-info-item span:first-child {
    width: 70px;
    flex-shrink: 0;
}

.direction-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-state .hint {
    font-size: 14px;
    color: var(--secondary-color);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius);
}

.modal-close:hover {
    background: var(--bg-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.learning-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.learning-tab {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.learning-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.learning-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.learning-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-height: 400px;
}

.learning-section {
    margin-bottom: 24px;
}

.learning-section:last-child {
    margin-bottom: 0;
}

.learning-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.learning-section p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.news-item {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.news-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.news-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.news-item-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.interview-config {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.interview-config .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.interview-questions {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.question-card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.question-card:last-child {
    margin-bottom: 0;
}

.question-number {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
}

.question-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.interview-config .btn {
    height: 42px;
}

.review-search {
    margin-bottom: 24px;
}

.review-results {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.review-item {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.review-item:last-child {
    margin-bottom: 0;
}

.review-source {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-color);
    color: var(--text-secondary);
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 10px;
}

.review-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.review-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.schedule-list {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.schedule-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-item:hover {
    background: var(--bg-color);
}

.schedule-date {
    min-width: 100px;
    text-align: center;
    padding-right: 20px;
    border-right: 1px solid var(--border-color);
    margin-right: 20px;
}

.schedule-date-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.schedule-date-month {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.schedule-info {
    flex: 1;
}

.schedule-info-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.schedule-info-company {
    font-size: 13px;
    color: var(--text-secondary);
}

.schedule-info-time {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.schedule-type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 12px;
}

.schedule-type-badge.interview {
    background: #dbeafe;
    color: var(--primary-color);
}

.schedule-type-badge.deadline {
    background: #fef3c7;
    color: var(--warning-color);
}

.schedule-type-badge.assessment {
    background: #d1fae5;
    color: var(--success-color);
}

.schedule-type-badge.other {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.schedule-actions {
    display: flex;
    gap: 8px;
}

.schedule-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.schedule-actions .edit-btn {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.schedule-actions .delete-btn {
    background: #fef2f2;
    color: var(--danger-color);
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.ai-content {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
}

.ai-content p {
    margin-bottom: 12px;
}

.ai-content p:last-child {
    margin-bottom: 0;
}

.structured-content {
    padding: 8px 0;
}

.content-section {
    margin-bottom: 28px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.section-body {
    padding-left: 4px;
}

.content-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.content-list-item {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.content-list-item .bullet {
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 16px;
}

.content-status {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.content-status.ready {
    background: #d1fae5;
    color: var(--success-color);
}

.content-status.generating {
    background: #fef3c7;
    color: var(--warning-color);
}

.content-status.pending {
    background: var(--bg-color);
    color: var(--text-secondary);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-card {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.news-card:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.news-source {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    background: #dbeafe;
    padding: 3px 10px;
    border-radius: 10px;
}

.news-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.news-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.news-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.interview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.interview-header-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.interview-header-info p {
    font-size: 14px;
    color: var(--primary-color);
    margin-top: 4px;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.question-group {
    margin-bottom: 20px;
}

.question-group-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.question-item {
    display: flex;
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.question-num {
    background: var(--primary-color);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    margin-right: 16px;
    flex-shrink: 0;
    height: fit-content;
}

.question-content {
    flex: 1;
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
}

.question-hint-item {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 48px;
    line-height: 1.6;
}

.question-desc {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0 8px 48px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        height: auto;
        padding: 16px;
    }

    .main-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .main-content {
        padding: 16px;
    }

    .company-list {
        grid-template-columns: 1fr;
    }

    .interview-config {
        flex-direction: column;
    }

    .interview-config .form-group {
        width: 100%;
    }

    .interview-config .btn {
        width: 100%;
    }
}