/* 全局样式和变量 */
:root {
    --primary-color: #1A1F2E;
    --secondary-color: #2A3441;
    --accent-color: #3498DB;
    --bg-primary: #E8EAED;
    --bg-secondary: #F5F5F5;
    --bg-sidebar: #E0E2E5;
    --text-primary: #1A1F2E;
    --text-secondary: #5A6570;
    --text-light: #9AA0A8;
    --text-category: #1A1F2E;
    --border-color: #C8CCD0;
    --hover-bg: #D8DCE0;
    --active-color: #3498DB;
    --vip-color: #E74C3C;
    --free-color: #27AE60;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 顶部导航栏 */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    color: var(--accent-color);
    display: flex;
    align-items: center;
}

.platform-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-center {
    display: flex;
    gap: 32px;
    align-items: center;
}

.tool-category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition);
    position: relative;
}

.tool-category:hover {
    background: var(--hover-bg);
}

.tool-category.active {
    color: var(--accent-color);
}

.tool-category.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent-color);
}

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.vip {
    background: var(--vip-color);
    color: white;
}

.badge.free {
    background: var(--free-color);
    color: white;
}

.badge.neutral {
    background: #e5e7eb;
    color: #374151;
}

.badge.beta {
    background: #f59e0b;
    color: white;
}

.badge.online {
    background: #16a34a;
    color: white;
}

.badge.notice {
    background: #2563eb;
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.user-center-btn,
.admin-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.user-center-btn:hover,
.admin-btn:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

.logout-btn {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.logout-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* 主导航栏 */
.main-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-container {
    display: flex;
    gap: 4px;
    min-width: max-content;
}

.nav-item {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    white-space: nowrap;
    position: relative;
    border-bottom: 2px solid transparent;
}

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

.nav-item.active {
    color: var(--active-color);
    border-bottom-color: var(--active-color);
    font-weight: 600;
}

/* 主容器 */
.main-container {
    display: flex;
    height: calc(100vh - 128px);
    gap: 1px;
    background: var(--border-color);
}

/* 左侧边栏 - 自适应宽度 */
.sidebar {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: 0 0 auto;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
}

.search-box svg {
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--text-light);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    color: var(--text-primary);
}

/* 确保侧边栏所有文字颜色保持主文字色，避免出现链接蓝色 */
.sidebar-content * {
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

.function-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    width: 100%;
}

.function-item {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    border: 1px solid var(--border-color);
    width: 100%;
    min-width: 0;
}

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

.function-item.active {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary) !important;
}

.function-item.function-parent {
    background: #B8BCC0 !important;
    color: white !important;
    display: inline-flex;
    width: auto;
    align-self: flex-start;
    max-width: 100%;
    padding-right: 2px;
}

.function-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.function-item span {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.45;
    text-align: left;
    color: var(--text-primary);
    text-decoration: none;
}

.function-item .arrow {
    display: none;
}

/* 分类标题样式 - 比整体灰度深20% */
.function-parent {
    background: linear-gradient(135deg, #B8BCC0 0%, #C0C4C8 100%) !important;
    color: #000000 !important;
    border: 1px solid #A8ACB0 !important;
    font-weight: 500;
}

.function-parent:hover {
    background: linear-gradient(135deg, #A8ACB0 0%, #B0B4B8 100%) !important;
    border-color: #989CA0 !important;
}

.function-parent.expanded {
    background: linear-gradient(135deg, #A0A4A8 0%, #A8ACB0 100%) !important;
    border-color: #3498DB !important;
}

.function-parent.expanded::after {
    color: #000000 !important;
}

.function-parent span {
    color: #000000 !important;
}

.function-parent::after {
    content: '▼';
    font-size: 10px;
    margin-left: 8px;
    transition: transform 0.2s ease;
    display: inline-block;
    color: #000000 !important;
    flex-shrink: 0;
    align-self: center;
}

.function-parent.expanded::after {
    transform: rotate(180deg);
}

/* 强制左侧菜单的文字颜色，避免某些场景继承为链接蓝色 */
.function-item:not(.function-parent) *, 
.sub-function-item, 
.sub-function-item * {
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

.sub-function-container {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 12px 0;
    padding-left: 0;
    border-left: none;
}

.sub-function-item {
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 8px 2px 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: auto;
    align-self: flex-start;
    min-width: 0;
    max-width: 100%;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow: hidden;
    line-height: 1.45;
    text-align: left;
}

.sub-function-item span {
    display: block;
    width: auto;
    min-width: 0;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-function-item:hover {
    background: var(--hover-bg);
}

.sub-function-item.active {
    background: linear-gradient(135deg, #1E6F5C 0%, #289672 100%);
    color: #FFFFFF !important;
    font-weight: 600;
    border-color: #1E6F5C;
}

/* 统一侧边栏文字颜色，采用建筑专业模板的文字色（排除分类父项） */
.sidebar .function-item:not(.function-parent),
.sidebar .function-item:not(.function-parent) span,
.sidebar .sub-function-item:not(.active),
.sidebar .sub-function-item:not(.active) span,
.function-item:not(.function-parent) *,
.sub-function-item:not(.active),
.sub-function-item:not(.active) * {
    color: var(--text-primary) !important;
    text-decoration: none !important;
}

/* 激活状态的子功能文字颜色 */
.sub-function-item.active,
.sub-function-item.active * {
    color: #FFFFFF !important;
}

/* 主内容区 */
.content-area {
    flex: 1;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.phase-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.phase-tabs-left {
    display: flex;
    gap: 8px;
}

/* 简化版/完全版与三阶段按键同一排右侧 */
.phase-tabs-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.phase-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 14px;
}

.phase-tab:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.phase-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
}

.phase-tab svg {
    width: 20px;
    height: 20px;
}

.function-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    position: relative;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
}

.empty-icon {
    margin-bottom: 24px;
    opacity: 0.6;
}

.empty-text {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 右侧面板 - 增加约40%宽度（在此前基础上再增10%） */
.right-panel {
    width: 412px;
    background: var(--bg-sidebar);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
}

.panel-icon {
    color: var(--accent-color);
    margin-bottom: 16px;
    opacity: 0.7;
    align-self: center;
}

.panel-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* 右侧面板结果区域 */
.right-panel-results {
    display: none;
    width: 100%;
}

.right-panel-results.active {
    display: block;
}

.right-panel-result-section {
    margin-bottom: 24px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.right-panel-result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.right-panel-result-title .toggle-icon {
    transition: transform 0.3s;
    color: var(--text-secondary);
}

.right-panel-result-title.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.right-panel-result-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.right-panel-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.right-panel-result-item:last-child {
    border-bottom: none;
}

.right-panel-result-label {
    color: var(--text-secondary);
}

.right-panel-result-value {
    color: var(--text-primary);
    font-weight: 500;
}

.code-comparison-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.comparison-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.comparison-value {
    font-size: 13px;
    font-weight: 500;
}

.comparison-value.pass {
    color: #27AE60;
}

.comparison-value.fail {
    color: #E74C3C;
}

.suggestion-item {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}

.suggestion-item.warning {
    background: #FFF3CD;
    border-left: 3px solid #FFC107;
    color: #856404;
}

.suggestion-item.info {
    background: #D1ECF1;
    border-left: 3px solid #17A2B8;
    color: #0C5460;
}

.suggestion-item.success {
    background: #D4EDDA;
    border-left: 3px solid #28A745;
    color: #155724;
}

/* 功能内容样式 */
.function-panel {
    display: none;
}

.function-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.function-form {
    max-width: 100%;
    margin: 0;
    padding: 0 8px;
}

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

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

/* 响应式表单布局 */
.form-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 8px;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-input, .form-select {
    width: 100%;
    box-sizing: border-box;
}

/* 响应式列数调整 */
@media (min-width: 1920px) {
    .form-row {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1600px) and (max-width: 1919px) {
    .form-row {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1599px) {
    .form-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .form-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #2980B9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.result-panel {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.result-content {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 版本切换按钮 */
.version-switch {
    display: flex;
    gap: 12px;
}

.version-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.version-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.version-btn.active {
    background: #FF6B35;
    border-color: #FF6B35;
    color: white;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.btn-calculate {
    background: #E74C3C;
    color: white;
}

.btn-calculate:hover {
    background: #C0392B;
}

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

.btn-export:hover, .btn-reset:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* 详情面板 */
.detail-panel {
    margin-top: 24px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.detail-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
}

.detail-panel-header:hover {
    background: var(--hover-bg);
}

.detail-panel-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-panel-toggle {
    font-size: 12px;
    color: var(--accent-color);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.detail-panel-toggle:hover {
    background: var(--hover-bg);
}

.detail-panel-content {
    padding: 16px;
    background: var(--bg-secondary);
    display: none;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: visible;
}

.detail-panel-content.active {
    display: block;
}

.detail-panel-content pre {
    background: var(--bg-primary);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.6;
}

/* 计算过程详情样式 */
.calculation-section {
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.calculation-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    grid-auto-flow: dense;
}

.calculation-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: auto;
    height: fit-content;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.calculation-item.highlight {
    background: rgba(52, 152, 219, 0.05);
    border: 2px solid var(--accent-color);
}

.calc-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
}

.calc-formula {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    word-wrap: break-word;
    white-space: normal;
}

.calc-result {
    color: #E74C3C;
    font-weight: 600;
    font-size: 13px;
}

/* 规范依据样式 */
.code-standard {
    margin-bottom: 24px;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 16px;
}

.code-standard:last-child {
    margin-bottom: 0;
}

.code-standard-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.code-standard-number {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.code-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.code-tab {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.code-tab:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.code-tab.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.code-article-content {
    display: block;
}

.article-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.article-regulations {
    margin-bottom: 16px;
}

.regulation-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.regulation-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
    min-width: 20px;
}

.regulation-content {
    flex: 1;
}

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

.regulation-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.code-table {
    margin-top: 16px;
}

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

.regulation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
}

.regulation-table thead {
    background: var(--bg-primary);
}

.regulation-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.regulation-table td {
    padding: 10px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

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

.regulation-table tbody tr:hover {
    background: var(--hover-bg);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    /* 中等屏幕：右侧面板仍保留，但适当缩窄宽度，表单改为两列 */
    .right-panel {
        width: 320px;
    }
    
    .form-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

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

    .header-center {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .main-nav {
        padding: 0 16px;
    }

    .main-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 200px);
    }

    .sidebar {
        width: 100%;
        max-height: 300px;
    }

    .phase-tabs {
        flex-wrap: wrap;
        padding: 16px;
    }

    .phase-tab {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }

    .function-content {
        padding: 16px;
    }

    /* 小屏：右侧面板改为占满宽度并排在主内容下方 */
    .right-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        max-height: 360px;
    }

    /* 小屏：操作按钮和版本切换允许换行，避免水平溢出 */
    .action-buttons {
        flex-wrap: wrap;
    }

    .version-switch {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .platform-title {
        font-size: 16px;
    }

    .tool-category {
        padding: 6px 12px;
        font-size: 13px;
    }

    .nav-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    .phase-tab {
        padding: 10px 16px;
        font-size: 13px;
    }

    .phase-tab span {
        display: none;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}



/* 规范对比样式 */
.code-comparison-item {
    padding: 12px;
    margin: 8px 0;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--border-color);
    transition: var(--transition);
}

.code-comparison-item:hover {
    background: var(--hover-bg);
    transform: translateX(2px);
}

.comparison-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.comparison-value {
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comparison-value.pass {
    color: var(--free-color);
    border-left-color: var(--free-color);
}

.comparison-value.fail {
    color: var(--vip-color);
    border-left-color: var(--vip-color);
}

.code-comparison-item .comparison-value.pass {
    border-left-color: var(--free-color);
}

.code-comparison-item .comparison-value.fail {
    border-left-color: var(--vip-color);
}

.comparison-source {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    font-style: italic;
}

/* 建议项样式 */
.suggestion-item {
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.6;
}

.suggestion-item.success {
    background: #E8F5E9;
    border-left-color: var(--free-color);
    color: #2E7D32;
}

.suggestion-item.info {
    background: #E3F2FD;
    border-left-color: var(--accent-color);
    color: #1565C0;
}

.suggestion-item.warning {
    background: #FFF3E0;
    border-left-color: #FF9800;
    color: #E65100;
}

.suggestion-item strong {
    font-weight: 600;
    margin-right: 4px;
}

/* 参数提示样式 */
.param-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    display: inline-block;
}

/* 规范条文列表样式 */
.code-article-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.code-article-list li {
    padding: 10px 14px;
    margin: 6px 0;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.7;
    transition: var(--transition);
}

.code-article-list li:hover {
    background: var(--hover-bg);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.code-article-list li span {
    color: var(--accent-color);
    font-weight: 500;
    margin-right: 8px;
}

/* 计算过程详情样式（与 staircase 楼梯模块保持一致） */
.calculation-section {
    margin-bottom: 24px;
}

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

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.calculation-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    grid-auto-flow: dense;
}

.calculation-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: auto;
    height: fit-content;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.calculation-item.highlight {
    background: rgba(52, 152, 219, 0.05);
    border: 2px solid var(--accent-color);
}

.calc-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    word-wrap: break-word;
}

.calc-formula {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    line-height: 1.8;
    word-wrap: break-word;
    white-space: normal;
}

.calc-result {
    color: #E74C3C;
    font-weight: 600;
    font-size: 13px;
}

/* 右侧面板结果样式增强 */
.right-panel-result-section {
    margin-bottom: 16px;
}

.right-panel-result-title {
    cursor: pointer;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    transition: var(--transition);
}

.right-panel-result-title:hover {
    background: var(--hover-bg);
}

.right-panel-result-title.collapsed + .right-panel-result-content {
    display: none;
}

.right-panel-result-content {
    padding: 12px 0;
}

.right-panel-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    margin: 4px 0;
    background: var(--bg-secondary);
    border-radius: 4px;
}

.right-panel-result-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.right-panel-result-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.right-panel-result-title.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* 建议样式 */
.suggestion-item {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    transition: var(--transition);
}

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

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

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.suggestion-icon {
    font-size: 18px;
    line-height: 1;
}

.suggestion-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.suggestion-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 26px;
}

.suggestion-item.success {
    background: #E8F5E9;
    border-left-color: #2E7D32;
}
.suggestion-item.success .suggestion-icon { color: #2E7D32; }

.suggestion-item.info {
    background: #E3F2FD;
    border-left-color: #1565C0;
}
.suggestion-item.info .suggestion-icon { color: #1565C0; }

.suggestion-item.warning {
    background: #FFF3E0;
    border-left-color: #FF9800;
}
.suggestion-item.warning .suggestion-icon { color: #E65100; }

.suggestion-item.error {
    background: #FFEBEE;
    border-left-color: #C62828;
}
.suggestion-item.error .suggestion-icon { color: #C62828; }

/* 规范条文项hover效果 */
.code-article-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

/* 版本切换按钮hover效果 */
.version-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.version-btn.active {
    background: var(--accent-color) !important;
    color: white !important;
    border-color: var(--accent-color) !important;
}

/* 规范标准信息框 */
.code-standard-info {
    animation: fadeIn 0.3s ease-in;
}

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

/* 规范条文容器 */
.code-articles-container {
    animation: slideIn 0.4s ease-out;
}

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


/* 规范标签页样式 */
.standard-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 16px;
}

.standard-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
    position: relative;
    top: 2px;
    border: 1px solid transparent;
}

.standard-tab:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.standard-tab.active {
    background: var(--accent-color) !important;
    color: white !important;
    border-color: var(--accent-color);
}

/* 计算项高亮样式 */
.calculation-item.highlight {
    background: #FFF3E0 !important;
    border-color: #FF9800 !important;
}

.calculation-item.highlight .calc-result {
    color: #FF9800;
}

/* 规范条文编号样式 */
.code-article-item {
    transition: all 0.3s ease;
}

.code-article-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left-color: var(--accent-color) !important;
}

/* 计算公式样式增强 */
.calc-formula {
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

.calc-result {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 14px;
}

/* 规范标准头部样式 */
.code-standard-header {
    padding: 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}


/* ==================== 功能卡片区域 ==================== */
.feature-cards-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
}

.feature-cards-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.feature-card.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: default;
}

.feature-card.active:hover {
    transform: none;
}

.feature-card-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    color: var(--accent-color);
}

.feature-card.active .feature-card-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.feature-card-content {
    flex: 1;
    position: relative;
}

.feature-card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.feature-card.active .feature-card-title {
    color: white;
}

.feature-card-desc {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.feature-card.active .feature-card-desc {
    color: rgba(255, 255, 255, 0.9);
}

.feature-card-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.feature-card-badge.vip {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.feature-card-badge.free {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.feature-card-badge.premium {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
}

.feature-card.active .feature-card-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .feature-cards-section {
        padding: 24px 16px;
    }
    
    .feature-cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    .feature-card-icon {
        width: 56px;
        height: 56px;
    }
    
    .feature-card-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .feature-card-title {
        font-size: 16px;
    }
    
    .feature-card-desc {
        font-size: 13px;
    }
}
