/* css/style.css */
body {
    margin: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f0f2f5;
}

/* ---------------- 目录选择页样式 ---------------- */
.directory-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    min-height: calc(100vh - 48px);
    box-sizing: border-box;
}

.directory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1890ff;
    padding-bottom: 15px;
    margin-bottom: 25px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.directory-header h2 { margin: 0; color: #333; }

/* 按钮通用样式 */
.btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-weight: bold;
    box-shadow: 0 2px 0 rgba(0,0,0,0.045);
}

.action-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.default-btn { background: #fff; color: #333; border: 1px solid #d9d9d9; box-shadow: none; }
.default-btn:hover { color: #1890ff; border-color: #1890ff; background: #f0f8ff; }

.primary-btn { background: #1890ff; color: white; }
.primary-btn:hover { background: #40a9ff; }
.primary-btn:disabled { background: #d9d9d9; cursor: not-allowed; box-shadow: none; color: #999; }

.directory-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-item:hover { background: #e6f7ff; border-color: #91d5ff; }
.checkbox-item input { margin-right: 20px; width: 18px; height: 18px; cursor: pointer; }

.form-id { font-weight: bold; width: 120px; color: #001529; font-family: monospace; font-size: 15px; }
.form-name { color: #555; font-size: 15px; }


/* ---------------- 工作台布局样式 ---------------- */
.workspace {
    display: flex;
    width: 100%;
    height: calc(100vh - 48px);
}

.sidebar {
    background-color: #001529;
    color: #a6adb4;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    background: #002140;
}

.back-btn {
    width: 100%;
    background: transparent;
    color: #177ddc;
    border: 1px solid #177ddc;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.back-btn:hover { background: #177ddc; color: #fff; }

.menu-item {
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    line-height: 1.4;
    white-space: nowrap; /* 侧边栏折叠时防换行 */
    overflow: hidden;
}

.menu-item:hover { color: #fff; background: rgba(0,0,0,0.15) !important; }
.menu-item.active { background-color: rgba(0,0,0,0.3) !important; color: #fff; border-left: 4px solid #fff; }

.content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    box-sizing: border-box; 
}

/* 顶部操作区 */
.workspace-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 15px;
}

.success-btn { background: #52c41a; color: white; }
.success-btn:hover { background: #73d13d; }
.danger-btn { background: #ff4d4f; color: white; }
.danger-btn:hover { background: #ff7875; }

.form-card {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}


/* ---------------- 表单内部元素样式 ---------------- */
.tax-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 13px; 
    table-layout: auto; /* 修改：由固定改为 auto，使得列可以根据内容宽度自适应伸长 */
}
.tax-table th, .tax-table td {
    border: 1px solid #333; 
    padding: 8px 12px;
    text-align: center;
    vertical-align: middle;
}
.tax-table th { background-color: #fafafa; font-weight: bold; color: #333; }
.tax-input {
    width: 100%;
    min-width: 100px; /* 修改：增加保底最小宽度 */
    padding: 6px;
    border: 1px solid #d9d9d9;
    border-radius: 2px;
    text-align: right;
    box-sizing: border-box;
    font-family: inherit;
    field-sizing: content; /* 修改核心：现代浏览器属性，允许输入框根据内容长度自动撑开变宽 */
}
.tax-input:focus { border-color: #1890ff; outline: none; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }
.tax-input[readonly] { background-color: #f5f5f5; cursor: not-allowed; color: #666; border-color: #e8e8e8;}

/* ---------------- 辅助排版样式 ---------------- */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.font-bold { font-weight: bold !important; }
.pl-2 { padding-left: 20px !important; }
.pl-4 { padding-left: 40px !important; }
.pl-6 { padding-left: 60px !important; }

.radio-group { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.radio-group label, .checkbox-label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap;}
.radio-group input[type="radio"], input[type="checkbox"] { margin: 0; cursor: pointer; }
.inline-input { border: none; border-bottom: 1px solid #333; border-radius: 0; padding: 0; text-align: center; outline: none; background: transparent;}
.inline-input:focus { box-shadow: none; border-bottom: 2px solid #1890ff; }

/* ---------------- 强制控制区 ---------------- */
/* 彻底解决 A104000 表格“项目”列文字换行问题 */
.table-A104000 th:nth-child(2),
.table-A104000 td:nth-child(2) {
    white-space: nowrap !important;
}