/* 木偶工具箱样式 - 顶部导航版 */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-card: rgba(40, 40, 40, 0.6);
    --accent-gold: #d4a574;
    --text-primary: #e0e0e0;
    --text-secondary: #9a8a7a;
    --text-muted: #6a6a6a;
    --border-color: rgba(80, 80, 80, 0.5);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 50%, #1a1a1a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* 头部 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(25, 25, 25, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 56px;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon { font-size: 24px; }

.logo-text {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-gold), #e4b584);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-search {
    flex: 1;
    max-width: 400px;
}

.header-search input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(50, 50, 50, 0.6);
    color: var(--text-primary);
    font-size: 13px;
}

.header-search input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.header-nav {
    display: flex;
    gap: 12px;
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.2s;
}

.header-nav a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* 分类导航 */
.header-cats {
    display: flex;
    padding: 0 15px;
    height: 44px;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.header-cats::-webkit-scrollbar { height: 0; }

.cat-item {
    position: relative;
    flex-shrink: 0;
}

.cat-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.cat-btn:hover, .cat-item.active .cat-btn {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.cat-item.active .cat-btn {
    color: var(--accent-gold);
}

.cat-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.cat-item.active .cat-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.cat-dropdown {
    position: fixed;
    top: 100px;
    
    max-height: 0;
    overflow: hidden;
    background: rgba(35, 35, 35, 0.98);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    transition: max-height 0.3s ease;
    z-index: 999999;
}

.cat-item.active .cat-dropdown {
    max-height: 400px;
}

.cat-link {
    display: block;
    padding: 10px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}

.cat-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.cat-link.hidden { display: none; }

/* 主内容 */
.main-content {
    padding: 120px 20px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 主页Hero */
.home-hero {
    text-align: center;
    padding: 30px 20px 40px;
}

.home-hero h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent-gold), #e4b584);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-hero p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
}

.home-search {
    max-width: 500px;
    margin: 0 auto;
}

.home-search input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(50, 50, 50, 0.6);
    color: var(--text-primary);
    font-size: 15px;
}

.home-search input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

/* 卡片网格 */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

.category-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-header {
    padding: 12px 16px;
    background: rgba(50, 50, 50, 0.4);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon { font-size: 20px; }

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

.category-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(100, 100, 100, 0.3);
    padding: 2px 6px;
    border-radius: 8px;
}

.category-tools { padding: 8px; }

.tool-link {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.15s;
    font-size: 13px;
}

.tool-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tool-link-text { flex: 1; }

.tool-link-arrow {
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.15s;
}

.tool-link:hover .tool-link-arrow { opacity: 0.5; }

.more-link { color: var(--accent-gold) !important; }

/* 工具页面 */
.tool-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 25px;
}

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

.tool-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 表单 */
.form-group { margin-bottom: 18px; }

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

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(50, 50, 50, 0.6);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    border: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #c9956b);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

.btn-secondary {
    background: rgba(100, 100, 100, 0.3);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover { background: rgba(100, 100, 100, 0.5); }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* 结果区 */
.result-area {
    margin-top: 18px;
    padding: 16px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.result-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.result-content {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-all;
    white-space: pre-wrap;
}

.result-content.error { color: #e57373; }

/* 页脚 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: rgba(25, 25, 25, 0.98);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover { color: var(--accent-gold); }

/* 响应式 */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .header-top { height: 50px; }
    .main-content { padding: 110px 15px 70px; }
    .home-hero h1 { font-size: 26px; }
    .home-grid { grid-template-columns: 1fr; }
    .header-cats { padding: 0 10px; }
    .cat-btn { padding: 8px 12px; font-size: 12px; }
}
