/* ========== CSS変数定義 ========== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #8b6464;
    --text-color: #1e293b;
    --text-light: #8b6464;
    --border-color: #f0e2e2;
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --bg-gray: #f1f5f9;
    --bg-hover: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
}

body,p {
    letter-spacing: -.5px;	
}
.inner {
    max-width: 980px;
}
.mb {
    display: none !important;
}

.ds_header {
    position: relative;
    padding: 20px 0px 120px;
    background: var(--red);
    overflow: hidden;
}
.ds_header .ds_lead {
    margin-bottom: 60px;
    padding: 15px;
    /* width: 300px; */
    background: #fff;
    border-radius: 5px;
}

.ds_header .ds_lead .flex_in {
    align-items: center;
}
.ds_header .ds_lead img.logo {
    width: 260px;
}
.ds_header .ds_lead .main_logo {
    margin-left: 7px;
    font-size: 11px;
}
.ds_header .ds_lead .main_logo a {
    color: #333;
}
.ds_header .wrap {
    position: relative;
    z-index: 2;
    padding-top: 30px;
    max-width: 700px;
}
.ds_header .wrap h1 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 54px;
    font-weight: 800;
}
.ds_header .wrap p {
    margin: 0 0 40px 5px;
    font-size: 22px;
    color: #fff;
    letter-spacing: 0px;
}
.ds_header .memo {
    position: relative;
    z-index: 2;
	color: #fff;
	font-size: 12px;
    line-height: 1.6;
}
.ds_header .img {
    position: absolute;
    top: 0;
    right: -80px;
    z-index: 0;
}

.ds_header .img img {
    width: 452px;
}

/* ========== ベーススタイル ========== */


body {
    min-height: 100vh;
}

.container {
    background: var(--bg-white);
    margin: 0 auto;
}


/* ========== 検索ボックス ========== */
.search-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    background: var(--base);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    letter-spacing: 0;
    background: var(--bg-white);
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgb(235 37 37 / 10%);
}

button {
    width: 100%;
    padding: 14px 32px;
    background: var(--black);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    background: #000;
}

button:active:not(:disabled) {
    transform: scale(0.98);
}

button:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========== セクション ========== */
.section {
    margin-top: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0;
    overflow: hidden;
}

.section h2 {
    font-size: clamp(1rem, 3vw, 1.1rem);
    background: var(--base);
    color: var(--red);
    margin: 0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.section h2::before {
    content: "●";
    margin-right: 10px;
    font-size: 0.8em;
    color: var(--red);
}

.section > div:not(.link-table-wrapper):not(.resources-grid) {
    padding: 20px;
}

/* ========== 情報アイテム ========== */




.progress-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 8px 0;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.progress-item.active {
    background: #e3f2fd;
    border-left-color: #2196f3;
    transform: translateX(4px);
}

.progress-item.done {
    background: #e8f5e9;
    border-left-color: #4caf50;
    opacity: 0.7;
}

.progress-icon {
    font-size: 18px;
    margin-right: 12px;
    min-width: 24px;
    display: inline-block;
}

.progress-text {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.progress-item.active .progress-text {
    color: #1976d2;
    font-weight: 600;
}

.progress-item.done .progress-text {
    color: #2e7d32;
}

/* アニメーション追加 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.progress-item.active .progress-icon {
    animation: pulse 1.5s ease-in-out infinite;
}


.info-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    padding: 14px;
    background: #f7f7f7;
    border-radius: var(--radius-sm);
    gap: 6px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
}

.info-value {
    word-break: break-word;
    color: var(--text-color);
    font-size: 0.95rem;
}

strong {
    color: #111;
    font-weight: 500;
}

.info-value a {
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
}

.info-value a:hover {
    text-decoration: underline;
}

/* ========== Whois生データ ========== */
.whois-raw {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.6;
    margin: 20px;
}

/* シェアボタン */
.share-buttons {
    text-align: center;
    margin: 30px 0 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.share-text {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.share-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: inherit;
    padding: 0;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-btn.twitter {
    background: #000000;
    color: #fff;
}

.share-btn.twitter:hover {
    background: #1a1a1a;
}

.share-btn.facebook {
    background: #1877f2;
    color: #fff;
}

.share-btn.facebook:hover {
    background: #0d6efd;
}

.share-btn.line {
    background: #06C755;
    color: #fff;
}

.share-btn.line:hover {
    background: #05b34c;
}

.share-btn.copy {
    background: #6c757d;
    color: #fff;
}

.share-btn.copy:hover {
    background: #5a6268;
}

.share-btn.copy.copied {
    background: var(--red);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .share-buttons {
        margin: 20px 0 15px;
        padding: 15px;
    }
    
    .share-btn {
        width: 44px;
        height: 44px;
    }
}

/* ========== バッジ表示 ========== */
.tags-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-list li {
    background: var(--bg-white);
    color: var(--red);
    border: 1px solid var(--red);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

/*
.cms-badge {
    background: var(--bg-white) !important;
    color: var(--error-color) !important;
    border: 1px solid var(--error-color) !important;
}
*/

/* ========== パフォーマンスグレード ========== */
.performance-grade {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--bg-white);
}

.grade-a {
    background: var(--success-color);
}

.grade-b {
    background: var(--info-color);
}

.grade-c {
    background: var(--warning-color);
}

.grade-d {
    background: var(--error-color);
}

/* ========== リソース統計グリッド ========== */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 20px;
}

.resource-item {
    background: var(--bg-hover);
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s ease;
}

.resource-item:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-sm);
}

.resource-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--red);
    display: block;
    margin-bottom: 8px;
}

.resource-label {
    font-size: 0.85em;
    color: var(--text-light);
    font-weight: 500;
}

/* ========== エラー表示 ========== */
.error {
    color: var(--error-color);
    display: none;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--error-color);
    font-weight: 500;
}

/* ========== ローディング ========== */
.loading {
    display: none;
    text-align: center;
    margin: 60px 0;
    color: var(--text-light);
    font-weight: 500;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--red);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 結果表示 ========== */
.results {
    display: none;
}

.analysis-item h3 {
    position: relative;
    margin: 20px 0 15px;
    padding: 12px 0px 12px 20px;
    font-size: 18px;
    line-height: 1.6;
    font-weight: 600;
    color: var(--red);
    border-left: 2px solid var(--red);
}

/* ========== テーブル（リンク一覧・ヘッダー構成） ========== */
.link-table-wrapper {
    max-height: 400px;
    overflow: auto;
    border-radius: 0;
    margin: 0;
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    min-width: 600px;
}

table th {
    background: var(--red);
    color: var(--bg-white);
    position: sticky;
    top: 0;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    z-index: 10;
    white-space: nowrap;
}

table td {
    max-width: 200px;
    padding: 12px 16px;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-white);
}

table tr:hover td {
    background: var(--bg-hover);
}

table td a {
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

table td a:hover {
    text-decoration: underline;
}

/* ヘッダー構成テーブル */
.header-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    min-width: 700px;
}

.header-table th,
.header-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.header-table th {
    background: var(--red);
    color: var(--bg-white);
    font-weight: 600;
    font-size: 0.9em;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.header-table tr:hover td {
    background: var(--bg-hover);
}

/* ========== レスポンシブデザイン ========== */
@media (min-width: 768px) {

    .container {
        padding: 40px;
    }
    
    .search-box {
        flex-direction: row;
        padding: 24px;
    }
    
    button {
        width: auto;
        min-width: 160px;
    }
    
    .info-item {
        flex-direction: row;
        align-items: flex-start;
        padding: 16px;
    }
    
    .info-label {
        width: 180px;
        flex-shrink: 0;
        font-size: 0.9rem;
    }
    
    .info-value {
        flex: 1;
    }
    
    .resources-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    h1 {
        margin-bottom: 24px;
    }
    
    .section h2 {
        padding: 14px 16px;
    }
    
    .section > div:not(.link-table-wrapper):not(.resources-grid) {
        padding: 16px;
    }
    
    .whois-raw {
        margin: 16px;
        padding: 16px;
        font-size: 0.8em;
    }
    
    .performance-grade {
        font-size: 1.1rem;
        padding: 5px 14px;
    }
    
    .resource-count {
        font-size: 1.6rem;
    }
    
    /* スマホでテーブルを横スクロール可能に */
    .link-table-wrapper {
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        display: table;
        min-width: 600px;
    }
    
    .header-table {
        display: table;
        min-width: 700px;
    }
}

/* ========== スクロールバーのスタイリング ========== */
.link-table-wrapper::-webkit-scrollbar,
.whois-raw::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.link-table-wrapper::-webkit-scrollbar-track,
.whois-raw::-webkit-scrollbar-track {
    background: var(--base);
    border-radius: 10px;
}

.link-table-wrapper::-webkit-scrollbar-thumb,
.whois-raw::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

.link-table-wrapper::-webkit-scrollbar-thumb:hover,
.whois-raw::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}


/* スマホに適用させるCSS */
@media screen and ( max-width:880px ) {

    .pc {
        display: none !important;
    }
    .mb {
        display: block !important;
    }
    .ds_header {
    	position: relative;
    	padding: 20px 0px 60px;
    }
	.ds_header .ds_lead {
	    margin-bottom: 20px;
	}
	.ds_header .ds_lead .logo img {
	    width: 170px;
	}
	.ds_header .ds_lead .main_logo {
	    display: block;
	    margin: 3px 0 0;
	}
	.ds_header .ds_lead .main_logo .t_mb {
	    display: none;
	}
	.ds_header .img {
        position: absolute;
        top: 36px;
        right: -97px;
	}
	.ds_header .img img {
	    width: 250px;
	}
	.ds_header .wrap {
    	padding-top: 20px;
	    padding-right: 80px;
	}
	.ds_header .wrap h1 {
        font-size: 7.5vw;
        letter-spacing: -.7px;
	}
	.ds_header .wrap p {
	    margin: 0 0 30px 0;
	    font-size: 11px;
        text-shadow: 2px 1px 3px #831c13;
	}
	.search-box {
	    position: relative;
	    z-index: 3;
	}
	button#searchBtn {
	    margin-top: 15px;
	}
	input[type="text"] {
	    padding: 14px 12px;
	    font-size: 13px;
	}
	.ds_header .memo {
	    font-size: 11px;
	}

}