/* css/style.css */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    padding: 20px;
    flex: 1;
}

h1 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* --- 独立导航栏组件样式 --- */
.navbar {
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    padding: 0 20px;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
}

.nav-left {
    gap: 30px;
}

.nav-right {
    gap: 16px;
    margin-left: auto;
}

.nav-brand {
    font-size: 18px;
    font-weight: bold;
    color: #4a90d9;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

/* 带有下拉的导航项外壳 */
.nav-item {
    position: relative;
    padding: 18px 0;
    /* 放大可感应区域，解决悬停丢失问题 */
}

/* 导航基础链接与用户按钮样式复用 */
.nav-item>a,
.user-btn,
.nav-links>a {
    text-decoration: none;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.nav-item>a:hover,
.nav-item>a.active,
.user-btn:hover,
.nav-links>a:hover,
.nav-links>a.active {
    color: #4a90d9;
    background: #f0f8ff;
}

/* 下拉菜单指示箭头 */
.nav-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.nav-item:hover .nav-arrow {
    transform: rotate(180deg);
}

/* 下拉面板 */
.dropdown-menu {
    position: absolute;
    top: 55px;
    left: 0;
    min-width: 150px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    padding: 8px 0;
    pointer-events: none;
    border: 1px solid #eaeaea;
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu a {
    display: block;
    padding: 8px 20px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
    background: #f0f8ff;
    color: #4a90d9;
}

/* 下拉内分割线 */
.dropdown-divider {
    height: 1px;
    background: #eaeaea;
    margin: 6px 0;
}

/* 右侧对齐的下拉面板 */
.dropdown-menu-right {
    left: auto;
    right: 0;
}

/* 用户状态与头像区 */
.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90d9, #00d2ff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    margin-right: 4px;
}

.nav-auth-btn {
    font-size: 13px;
    padding: 6px 16px;
    background: #fff;
    color: #4a90d9;
    border: 1px solid #4a90d9;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-auth-btn:hover {
    background: #4a90d9;
    color: #fff;
}

/* --- 独立底部栏组件样式 --- */
.footer {
    background: #fff;
    padding: 24px 20px;
    margin-top: auto;
    border-top: 1px solid #eaeaea;
    text-align: center;
}

.footer-container p {
    color: #888;
    font-size: 13px;
    margin-bottom: 8px;
}

.footer-container a {
    color: #4a90d9;
    text-decoration: none;
    margin: 0 6px;
    font-size: 12px;
}

.footer-container a:hover {
    text-decoration: underline;
}

/* --- 原有页面业务组件样式 --- */
.card {
    background: #fff;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.row {
    display: flex;
    gap: 14px;
}

.col {
    flex: 1;
}

label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: bold;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 8px;
    font-size: 13px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    resize: vertical;
    font-family: Consolas, monospace;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #4a90d9;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

select {
    padding: 7px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
}

button {
    padding: 7px 20px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.btn-gen {
    background: #4a90d9;
    color: #fff;
}

.btn-gen:hover {
    background: #357abd;
}

.btn-copy {
    background: #52c41a;
    color: #fff;
}

.btn-copy:hover {
    background: #3da00e;
}

.btn-clear {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #d0d0d0;
}

.btn-clear:hover {
    background: #e8e8e8;
}

.stat {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}

#output {
    width: 100%;
    height: 320px;
    padding: 8px;
    font-size: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    resize: vertical;
    font-family: Consolas, monospace;
    line-height: 1.7;
    background: #fafafa;
}

.tip {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.highlight {
    color: #e85d27;
    font-weight: bold;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .stat {
        margin-left: 0;
        text-align: center;
        margin-top: 10px;
    }

    .nav-links {
        display: none;
    }
}