/* ============================================
   LinuxML - Linux 命令大全 样式表
   移动优先，响应式设计，SEO 友好
   ============================================ */

/* --- Reset & Base --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;font-size:16px}
body{
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans SC",sans-serif;
    line-height:1.7;
    color:#2d3436;
    background:#f8f9fa;
}
a{color:#0984e3;text-decoration:none;transition:color .2s}
a:hover{color:#0767b3}
img{max-width:100%;height:auto}
.container{max-width:1140px;margin:0 auto;padding:0 20px}

/* --- Header --- */
.site-header{
    background:#1a1a2e;
    color:#fff;
    padding:0;
    position:sticky;
    top:0;
    z-index:100;
    box-shadow:0 2px 10px rgba(0,0,0,.2);
}
.site-header .container{
    display:flex;
    align-items:center;
    height:60px;
    gap:24px;
}
.logo{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:1.4rem;
    font-weight:700;
    color:#fff!important;
    white-space:nowrap;
}
.logo-icon{
    background:#00b894;
    color:#fff;
    width:34px;height:34px;
    display:flex;align-items:center;justify-content:center;
    border-radius:6px;
    font-family:monospace;
    font-size:1.2rem;
}
.main-nav{display:flex;gap:4px}
.main-nav a{
    color:#ccc;
    padding:6px 14px;
    border-radius:6px;
    font-size:.95rem;
    transition:all .2s;
}
.main-nav a:hover,.main-nav a.active{background:rgba(255,255,255,.1);color:#fff}

.header-search{position:relative;flex:1;max-width:360px;margin-left:auto}
.header-search input{
    width:100%;
    padding:8px 14px;
    border:1px solid rgba(255,255,255,.2);
    border-radius:8px;
    background:rgba(255,255,255,.1);
    color:#fff;
    font-size:.9rem;
    outline:none;
    transition:all .2s;
}
.header-search input::placeholder{color:rgba(255,255,255,.5)}
.header-search input:focus{background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.4)}
.search-results-dropdown{
    display:none;
    position:absolute;top:100%;left:0;right:0;
    background:#fff;color:#333;
    border-radius:0 0 8px 8px;
    box-shadow:0 8px 24px rgba(0,0,0,.15);
    max-height:360px;overflow-y:auto;
    z-index:200;
}
.search-results-dropdown.active{display:block}
.search-results-dropdown a{
    display:flex;align-items:center;gap:10px;
    padding:10px 14px;
    color:#333;
    border-bottom:1px solid #f0f0f0;
    font-size:.9rem;
}
.search-results-dropdown a:hover{background:#f0f4ff}
.search-results-dropdown .cmd-badge{
    background:#0984e3;color:#fff;
    padding:2px 8px;border-radius:4px;
    font-family:monospace;font-size:.8rem;
}
.search-results-dropdown .no-result{padding:16px;text-align:center;color:#999}

/* --- Hero --- */
.hero{
    background:linear-gradient(135deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%);
    color:#fff;
    padding:60px 0 50px;
    text-align:center;
}
.hero h1{font-size:2.2rem;margin-bottom:12px}
.hero h1 span{color:#00b894}
.hero p{color:#b2bec3;font-size:1.1rem;max-width:600px;margin:0 auto 28px}
.hero-search{max-width:560px;margin:0 auto;position:relative}
.hero-search input{
    width:100%;
    padding:14px 20px;
    border:none;
    border-radius:12px;
    font-size:1.05rem;
    outline:none;
    box-shadow:0 4px 20px rgba(0,0,0,.3);
}
.hero-search .hero-search-results{
    display:none;
    position:absolute;top:100%;left:0;right:0;
    background:#fff;color:#333;
    border-radius:0 0 12px 12px;
    box-shadow:0 8px 24px rgba(0,0,0,.2);
    max-height:400px;overflow-y:auto;
    z-index:100;
    text-align:left;
}
.hero-search .hero-search-results.active{display:block}
.hero-search .hero-search-results a{
    display:flex;align-items:center;gap:12px;
    padding:12px 20px;
    color:#333;
    border-bottom:1px solid #f0f0f0;
}
.hero-search .hero-search-results a:hover{background:#f0f4ff}

.hero-stats{
    display:flex;justify-content:center;gap:40px;
    margin-top:32px;
}
.hero-stat{text-align:center}
.hero-stat .num{font-size:1.8rem;font-weight:700;color:#00b894}
.hero-stat .label{font-size:.85rem;color:#b2bec3}

/* --- Section Titles --- */
.section-title{
    font-size:1.6rem;
    margin:40px 0 20px;
    padding-bottom:10px;
    border-bottom:3px solid #00b894;
    display:inline-block;
}

/* --- Category Grid --- */
.category-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:16px;
    margin-bottom:32px;
}
.category-card{
    background:#fff;
    border-radius:10px;
    padding:20px;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
    transition:all .25s;
    border-left:4px solid transparent;
}
.category-card:hover{
    transform:translateY(-3px);
    box-shadow:0 6px 20px rgba(0,0,0,.1);
}
.category-card h3{font-size:1.05rem;margin-bottom:8px}
.category-card p{color:#636e72;font-size:.88rem;line-height:1.5}
.category-card.file{border-left-color:#0984e3}
.category-card.text{border-left-color:#6c5ce7}
.category-card.system{border-left-color:#e17055}
.category-card.network{border-left-color:#00b894}
.category-card.perm{border-left-color:#fdcb6e}
.category-card.process{border-left-color:#e84393}
.category-card.compress{border-left-color:#00cec9}
.category-card.package{border-left-color:#fd79a8}

.category-card h3 a{color:#2d3436}
.category-card h3 a:hover{color:#0984e3}

/* --- Command Grid (首页) --- */
.command-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
    gap:14px;
    margin-bottom:40px;
}
.cmd-card{
    background:#fff;
    border-radius:10px;
    padding:18px 20px;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
    transition:all .2s;
    display:flex;align-items:center;gap:14px;
}
.cmd-card:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,.1)}
.cmd-card .cmd-icon{
    width:44px;height:44px;
    background:#0984e3;color:#fff;
    border-radius:8px;
    display:flex;align-items:center;justify-content:center;
    font-family:"SF Mono","Fira Code","Cascadia Code",Consolas,monospace;
    font-weight:700;font-size:1rem;
    flex-shrink:0;
}
.cmd-card .cmd-info{flex:1;min-width:0}
.cmd-card .cmd-info h4{font-size:1rem;margin-bottom:3px}
.cmd-card .cmd-info h4 a{color:#2d3436}
.cmd-card .cmd-info h4 a:hover{color:#0984e3}
.cmd-card .cmd-info p{font-size:.82rem;color:#636e72;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cmd-card .cmd-tag{
    background:#dfe6e9;color:#636e72;
    padding:3px 8px;border-radius:4px;
    font-size:.72rem;white-space:nowrap;
}

/* --- Command Detail Page --- */
.breadcrumb{padding:14px 0;font-size:.85rem;color:#999}
.breadcrumb a{color:#0984e3}
.breadcrumb span{color:#636e72}

.cmd-detail-header{
    background:#fff;
    border-radius:12px;
    padding:28px 32px;
    margin-bottom:24px;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.cmd-detail-header .cmd-name{
    font-size:2rem;
    font-family:"SF Mono","Fira Code","Cascadia Code",Consolas,monospace;
    color:#00b894;
    margin-bottom:6px;
}
.cmd-detail-header .cmd-title{font-size:1.3rem;color:#2d3436;margin-bottom:12px}
.cmd-detail-header .cmd-desc{color:#636e72;line-height:1.8;margin-bottom:16px}
.cmd-tags{display:flex;gap:8px;flex-wrap:wrap}
.cmd-tags .tag{
    padding:4px 12px;border-radius:20px;
    font-size:.78rem;font-weight:500;
}
.tag-category{background:#dfe6e9;color:#2d3436}

/* Detail Sections */
.detail-card{
    background:#fff;
    border-radius:12px;
    padding:24px 32px;
    margin-bottom:20px;
    box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.detail-card h2{
    font-size:1.2rem;
    margin-bottom:16px;
    padding-bottom:8px;
    border-bottom:2px solid #f0f0f0;
    color:#2d3436;
}
.detail-card h2 .section-icon{margin-right:8px}

/* Syntax box */
.syntax-box{
    background:#1a1a2e;
    color:#00b894;
    padding:14px 20px;
    border-radius:8px;
    font-family:"SF Mono","Fira Code","Cascadia Code",Consolas,monospace;
    font-size:1rem;
    overflow-x:auto;
    white-space:pre-wrap;
    word-break:break-all;
}

/* Options table */
.option-table{width:100%;border-collapse:collapse}
.option-table td{
    padding:10px 14px;
    border-bottom:1px solid #f0f0f0;
    vertical-align:top;
}
.option-table td:first-child{
    font-family:"SF Mono","Fira Code",Consolas,monospace;
    font-weight:600;
    color:#e17055;
    white-space:nowrap;
    width:120px;
}
.option-table td:last-child{color:#636e72;font-size:.92rem}

/* Example list */
.example-list{list-style:none}
.example-list li{
    padding:14px 16px;
    border-bottom:1px solid #f0f0f0;
    transition:background .15s;
}
.example-list li:hover{background:#f8f9fa}
.example-list li:last-child{border-bottom:none}
.example-list .example-cmd{
    font-family:"SF Mono","Fira Code","Cascadia Code",Consolas,monospace;
    background:#1a1a2e;
    color:#00b894;
    padding:8px 14px;
    border-radius:6px;
    display:inline-block;
    margin-bottom:6px;
    font-size:.92rem;
}
.example-list .example-desc{color:#636e72;font-size:.9rem}

/* Related commands */
.related-list{display:flex;flex-wrap:wrap;gap:8px}
.related-list a{
    background:#dfe6e9;
    color:#2d3436;
    padding:6px 14px;
    border-radius:20px;
    font-size:.88rem;
    font-family:"SF Mono","Fira Code",Consolas,monospace;
    transition:all .2s;
}
.related-list a:hover{background:#0984e3;color:#fff}

/* Tips */
.tips-box{
    background:#fff3cd;
    border-left:4px solid #fdcb6e;
    padding:14px 18px;
    border-radius:0 8px 8px 0;
    font-size:.92rem;
    color:#856404;
    margin-top:12px;
}

/* --- Footer --- */
.site-footer{
    background:#1a1a2e;
    color:#b2bec3;
    padding:40px 0 20px;
    margin-top:60px;
}
.footer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:30px}
.footer-col h4{color:#fff;margin-bottom:12px;font-size:.95rem}
.footer-col p,.footer-col li{font-size:.85rem;line-height:1.8}
.footer-col ul{list-style:none}
.footer-col a{color:#b2bec3;transition:color .2s}
.footer-col a:hover{color:#fff}
.footer-bottom{
    text-align:center;
    margin-top:30px;padding-top:16px;
    border-top:1px solid rgba(255,255,255,.1);
    font-size:.8rem;
}

/* --- Back to Top --- */
.back-to-top{
    position:fixed;bottom:30px;right:30px;
    width:44px;height:44px;
    background:#0984e3;color:#fff;
    border:none;border-radius:50%;
    cursor:pointer;
    font-size:1.2rem;
    box-shadow:0 4px 12px rgba(0,0,0,.2);
    display:none;
    align-items:center;justify-content:center;
    z-index:50;
    transition:all .2s;
}
.back-to-top.visible{display:flex}
.back-to-top:hover{background:#0767b3}

/* --- Ad placeholder --- */
.ad-placeholder{
    background:#f0f0f0;
    border:1px dashed #ccc;
    border-radius:8px;
    padding:20px;
    text-align:center;
    color:#999;
    font-size:.85rem;
    margin:20px 0;
}

/* ============ Responsive ============ */
@media(max-width:768px){
    .site-header .container{flex-wrap:wrap;height:auto;padding:10px 15px;gap:10px}
    .main-nav{order:3;width:100%;justify-content:center}
    .header-search{order:2;max-width:none;flex:1}
    .hero h1{font-size:1.5rem}
    .hero p{font-size:.95rem}
    .hero-stats{gap:20px}
    .hero-stat .num{font-size:1.3rem}
    .category-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
    .command-grid{grid-template-columns:1fr}
    .cmd-detail-header,.detail-card{padding:18px 16px}
    .option-table td:first-child{width:90px}
    .footer-grid{grid-template-columns:1fr 1fr}
}
@media(max-width:480px){
    .hero{padding:40px 0 32px}
    .hero h1{font-size:1.3rem}
    .category-grid{grid-template-columns:1fr 1fr}
    .footer-grid{grid-template-columns:1fr}
}
