:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --table-header-bg: #e9ecef;
    --table-border-color: #dee2e6;
    --text-color: #212529;
    --white: #fff;
    --modal-backdrop: rgba(0, 0, 0, 0.5);
    --box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

#root {
    padding: 1.5rem 1.5rem 3.75rem 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    height: 100vh;
    overflow: hidden;
}

header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 1px 2px rgba(255,255,255,0.8);
    border: 1px solid rgba(0,123,255,0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,123,255,0.4);
    letter-spacing: 2px;
}

header p {
    font-size: 1.375rem;
    color: #495057;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(73,80,87,0.4);
    opacity: 0.9;
    letter-spacing: 1px;
}

.table-container {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    background: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    position: relative;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.table-container::-webkit-scrollbar {
    display: none;
}

.process-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1200px;
}

.process-table tbody tr:last-child th,
.process-table tbody tr:last-child td {
    border-bottom: 1px solid #dee2e6;
}

.process-table th,
.process-table td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
}

.process-table thead th {
    background-color: var(--table-header-bg);
    position: sticky;
    top: 0;
    z-index: 15;
    font-weight: 600;
    vertical-align: middle;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    text-align: center;
    height: 100%;
}

.cn-text {
    font-weight: 600;
    font-size: 0.95em;
}

.en-text {
    font-weight: 400;
    font-size: 0.8em;
    color: var(--secondary-color);
    opacity: 0.8;
    line-height: 1.2;
}

.process-table thead th:first-child {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 25;
    text-align: center;
    vertical-align: middle;
    font-size: 1.125rem;
    font-weight: 600;
}

.process-table .knowledge-area-header {
    background-color: var(--table-header-bg);
    font-weight: 500;
    width: 200px;
    position: sticky;
    left: 0;
    z-index: 20;
    word-wrap: break-word;
    hyphens: auto;
    vertical-align: middle;
}

.process-table td {
    background-color: var(--white);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.8), 0 1px 2px rgba(0,0,0,0.05);
}

.process-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}

.process-button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    font-size: 1.125rem;
    text-align: center;
    line-height: 1.2;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    width: 100%;
}

.process-button:hover,
.process-button:focus {
    background-color: var(--primary-hover);
    transform: scale(0.98);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-backdrop);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background-color: var(--white);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    color: var(--secondary-color);
}

.modal-header {
    border-bottom: 1px solid var(--table-border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0;
}

.modal-header p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.process-description {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.process-description h3 {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.process-description p {
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    white-space: pre-line;
}

.itto-section {
    margin-bottom: 1.5rem;
}

.itto-section h3 {
    font-weight: 500;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 0.5rem;
}

.itto-list {
    list-style-type: none;
    padding-left: 0;
}

.itto-list li {
    background-color: var(--background-color);
    border: 1px solid var(--table-border-color);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.itto-list li:hover {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.itto-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--modal-backdrop);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 1rem;
}

.itto-modal-content {
    background-color: var(--white);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.itto-modal-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--table-border-color);
}

.itto-modal-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.itto-modal-body {
    display: flex;
    gap: 2rem;
}

.itto-section-column {
    flex: 1;
}

.itto-section-column h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--table-border-color);
}

.process-list {
    list-style: none;
    padding: 0;
}

.process-list li {
    background-color: var(--background-color);
    border: 1px solid var(--table-border-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.process-list li:hover {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
}

.tool-processes {
    margin-top: 2rem;
}

.tool-processes h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--table-border-color);
}

/* Mobile Full Screen Optimization */
@media (max-width: 800px) {
    body {
        width: 100vw;
    }
    
    #root {
        padding: 0;
        min-height: 100vh;
        width: 100vw;
        overflow-x: hidden;
    }
    
    header {
        margin-bottom: 1rem;
        padding: 0.5rem;
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 1px 2px rgba(255,255,255,0.8);
        border: 2px solid rgba(0,123,255,0.1);
    }
    
    header h1 {
        font-size: 1.6rem;
        line-height: 1.2;
        margin: 0;
    }
    
    header p {
        font-size: 0.9rem;
        margin: 0.3rem 0 0 0;
    }
    
    .table-container {
        border: 1px solid #dee2e6;
        border-radius: 16px;
        background: white;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        overflow-x: auto;
    }
    
    .process-table {
        width: 100%;
        min-width: unset;
        font-size: 0.75rem;
        border-collapse: separate;
        border-spacing: 0;
    }
    
    .process-table th,
    .process-table td {
        padding: 0.3rem 0.2rem;
        border: 1px solid #dee2e6;
    }
    
    .process-table thead th {
        font-size: 0.7rem;
        padding: 0.4rem 0.2rem;
        position: sticky;
        top: 0;
        background-color: var(--table-header-bg);
        z-index: 15;
        border-bottom: 1px solid #dee2e6;
    }
    
    .header-text {
        gap: 0.15rem;
    }
    
    .cn-text {
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    .en-text {
        font-size: 0.5rem;
        line-height: 1.0;
    }
    
    .knowledge-area-header .header-text {
        gap: 0.1rem;
    }
    
    .knowledge-area-header .cn-text {
        font-size: 0.6rem;
    }
    
    .knowledge-area-header .en-text {
        font-size: 0.5rem;
    }
    
    .process-table thead th:first-child {
        position: sticky;
        left: 0;
        top: 0;
        z-index: 25;
        text-align: center;
        vertical-align: middle;
        font-size: 0.6rem;
    }
    
    .knowledge-area-header {
        width: 18%;
        font-size: 0.65rem;
        line-height: 1.1;
        position: sticky;
        left: 0;
        background-color: var(--table-header-bg) !important;
        z-index: 20;
        padding: 0.2rem 0.1rem;
    }
    
    .process-table td:not(.knowledge-area-header) {
        width: 16.4%;
    }
    
    .process-buttons {
        gap: 0.2rem;
    }
    
    .process-button {
        font-size: 0.65rem;
        padding: 0.4rem 0.2rem;
        line-height: 1.2;
        min-height: 40px;
        margin-bottom: 0.2rem;
        border-radius: 3px;
        text-align: center;
    }
    
    .modal-overlay {
        padding: 1rem;
    }
    
    .modal-content {
        background-color: var(--white);
        border-radius: 16px;
        padding: 2rem;
        width: 100%;
        max-width: 800px;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    
    .modal-close-button {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        line-height: 1;
        color: var(--secondary-color);
    }
    
    .modal-header {
        border-bottom: 2px solid var(--table-border-color);
        padding-bottom: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .modal-header h2 {
        color: var(--primary-color);
        font-size: 1.8rem;
        margin: 0;
    }
    
    .modal-header p {
        color: var(--secondary-color);
        font-size: 0.9rem;
    }
    
    .process-description {
        margin-bottom: 1.5rem;
        padding: 1rem;
        background-color: var(--background-color);
        border-radius: 6px;
        border-left: 4px solid var(--primary-color);
    }
    
    .process-description h3 {
        font-weight: 500;
        margin-bottom: 0.75rem;
        color: var(--primary-color);
        font-size: 1.1rem;
    }
    
    .process-description p {
        line-height: 1.6;
        color: var(--text-color);
        margin: 0;
    }
    
    .itto-section {
        margin-bottom: 1.5rem;
    }
    
    .itto-section h3 {
        font-weight: 500;
        margin-bottom: 0.75rem;
        border-left: 4px solid var(--primary-color);
        padding-left: 0.5rem;
    }
    
    .itto-list li {
        background-color: var(--background-color);
        border: 1px solid var(--table-border-color);
        border-radius: 4px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.5rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .itto-list li:hover {
        background-color: #e3f2fd;
        border-color: var(--primary-color);
    }
}

/* Landscape mobile optimization */
@media (max-width: 800px) and (orientation: landscape) {
    .process-table {
        font-size: 0.7rem;
    }
    
    .process-button {
        font-size: 0.6rem;
        padding: 0.3rem 0.2rem;
        min-height: 36px;
    }
    
    .knowledge-area-header {
        font-size: 0.6rem;
        width: 90px;
    }
    
    .process-table thead th {
        font-size: 0.65rem;
        padding: 0.3rem 0.2rem;
    }
}