/* 通用布局与组件样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    margin: 0;
    padding: 0;
}

/* 顶部导航栏 - 参照Ant Design风格 */
.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
    white-space: nowrap;
}

.top-menu-left {
    display: flex;
    align-items: center;
}

.top-menu-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

/* 导航按钮样式 - 参照Ant Design按钮 */
.top-menu-right button {
    margin-left: 8px;
    padding: 6px 16px;
    background: #ffffff;
    color: #333333;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    height: 36px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-menu-right button:hover {
    color: #1677ff;
    border-color: #d9d9d9;
    background: #e6f7ff;
}

.top-menu-right button.active {
    color: #1677ff;
    border-color: #1677ff;
    background: #e6f7ff;
}

/* 主要按钮样式 */
.top-menu-right button.primary {
    color: #ffffff;
    border-color: #1677ff;
    background: #1677ff;
}

.top-menu-right button.primary:hover {
    color: #ffffff;
    border-color: #4096ff;
    background: #4096ff;
}

/* 图标按钮样式 */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #666666;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.icon-btn:hover {
    color: #1677ff;
    background: #e6f7ff;
    border-color: #91d5ff;
}

/* 主布局 */
.main-layout {
    max-width: 1200px;
    margin: 100px auto 32px;
    padding: 0 32px;
}

.card {
    border: 1px solid #e5e5e5;
    padding: 24px;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 24px;
}

.row {
    margin-bottom: 16px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

/* 按钮样式 */
button {
    padding: 10px 16px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:disabled {
    background: #9dbaf7;
    cursor: not-allowed;
}

/* 图标按钮 */
button.icon-btn,
button.btn-sm {
    background: #fff;
    color: #333;
    padding: 6px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

button.icon-btn:hover,
button.btn-sm:hover {
    background: #f8f9fa;
    border-color: #1677ff;
    color: #1677ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(22, 119, 255, 0.1);
}

button.icon-btn:disabled,
button.btn-sm:disabled {
    background: #f5f5f5;
    border-color: #e5e5e5;
    color: #bfbfbf;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

button.icon-btn img,
button.icon-btn svg,
button.btn-sm img,
button.btn-sm svg {
    width: 18px;
    height: 18px;
    display: block;
}

button.icon-btn:disabled img,
button.icon-btn:disabled svg,
button.btn-sm:disabled img,
button.btn-sm:disabled svg {
    filter: grayscale(1) opacity(0.3);
}

/* 小按钮样式 */
button.btn-sm {
    padding: 4px 8px;
    font-size: 13px;
    gap: 4px;
}

/* 上传按钮样式 */
button#btn_upload,
button#process_confirm,
button#tag_confirm {
    position: relative;
}

/* 自定义 Tooltip 样式 */
.icon-btn::after,
.btn-sm::after,
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0s linear 0.1s;
    z-index: 1000;
    margin-bottom: 8px;
    pointer-events: none;
}

.icon-btn:hover::after,
.btn-sm:hover::after,
[data-tip]:hover::after {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.1s ease, visibility 0s linear 0s;
}

.icon-btn:hover img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(2476%) hue-rotate(200deg) brightness(118%) contrast(119%);
}

/* ===== 用户菜单样式 ===== */
.top-menu-right {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.login-btn {
    padding: 6px 16px;
    background-color: #1677ff;
    color: white;
    border: 1px solid #1677ff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    height: 36px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover {
    background-color: #4096ff;
    border-color: #4096ff;
}

.user-menu {
    position: relative;
    display: inline-block;
}

.username {
    padding: 6px 16px;
    cursor: pointer;
    color: #333333;
    font-size: 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    height: 36px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.username:hover {
    color: #1677ff;
    background-color: #e6f7ff;
    border-color: #91d5ff;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background-color: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    padding: 4px 0;
    z-index: 1000;
    display: none;
    animation: antSlideDown 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 8px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    white-space: nowrap;
}

.user-dropdown a:hover {
    background-color: #f0f9ff;
    color: #1677ff;
}

/* ===== 首页模块卡片样式 ===== */
.hero-section {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f7ff 100%);
    border-radius: 16px;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.1rem;
    color: #666;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.module-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #1677ff;
}

.module-icon {
    width: 56px;
    height: 56px;
    background: #e6f7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #1677ff;
}

.module-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.module-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.visit-btn {
    align-self: flex-start;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

/* 进度条 */
.progress {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.bar {
    height: 100%;
    width: 0%;
    background: #52c41a;
    transition: width 0.2s ease;
}

.muted {
    color: #666;
    font-size: 13px;
}

/* 表格样式 */
.table-wrap {
    max-height: 420px;
    overflow: auto;
}

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

.table th,
.table td {
    border: 1px solid #e5e5e5;
    padding: 8px 12px;
    vertical-align: middle;
    line-height: 1.5;
}

.table th {
    background: #f5f7fa;
    font-weight: 600;
}

.ops-icons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    min-height: 24px;
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.hidden {
    display: none;
}

/* 自定义 Tooltip 样式 */
.icon-btn {
    position: relative;
}

.icon-btn::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease, visibility 0s linear 0.1s;
    z-index: 1000;
    margin-bottom: 8px;
    pointer-events: none;
}

.icon-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.1s ease, visibility 0s linear 0s;
}

.icon-btn:hover img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(79%) saturate(2476%) hue-rotate(200deg) brightness(118%) contrast(119%);
}

/* ===== 用户菜单样式 ===== */
.top-menu-right {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.login-btn {
    padding: 6px 16px;
    background-color: #1677ff;
    color: white;
    border: 1px solid #1677ff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    height: 36px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover {
    background-color: #4096ff;
    border-color: #4096ff;
}

.user-menu {
    position: relative;
    display: inline-block;
}

.username {
    padding: 6px 16px;
    cursor: pointer;
    color: #333333;
    font-size: 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    height: 36px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.username:hover {
    color: #1677ff;
    background-color: #e6f7ff;
    border-color: #91d5ff;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background-color: white;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    padding: 4px 0;
    z-index: 1000;
    display: none;
    animation: antSlideDown 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 8px 16px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    white-space: nowrap;
}

.user-dropdown a:hover {
    background-color: #f0f9ff;
    color: #1677ff;
}

/* ===== 首页模块卡片样式 ===== */
.hero-section {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f7ff 100%);
    border-radius: 16px;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.hero-section p {
    font-size: 1.1rem;
    color: #666;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.module-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.module-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #1677ff;
}

.module-icon {
    width: 56px;
    height: 56px;
    background: #e6f7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #1677ff;
}

.module-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.module-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
}

.visit-btn {
    align-self: flex-start;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}